public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            DataRow[] dra = stafScheDataSet.UserPwd.Select("UserName='" + txtUser.Text + "'");
            if (dra.Length == 1)
            {
                string strPwd 
                    = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd.Text, "SHA1");
                if (strPwd == dra[0]["Password"].ToString())
                {
                    uc.User = txtUser.Text;
                    MessageBox.Show("Login success !");
                    StatusStrip ss = (StatusStrip)this.MdiParent.Controls.Find("StatusStrip1", true)[0];
                    ToolStripStatusLabel tssl = (ToolStripStatusLabel)ss.Items[0];
                    tssl.Text = uc.User;
                    MenuStrip menu = this.MdiParent.MainMenuStrip;
                    ToolStripMenuItem tsmi = (ToolStripMenuItem)menu.Items["baseToolStripMenuItem"];
                    tsmi.DropDownItems["loginToolStripMenuItem"].Enabled = false;
                    tsmi.DropDownItems["logoutToolStripMenuItem"].Enabled = true;
                    //tsmi.DropDownItems["atteKindtoolStripMenuItem"].Enabled = true;
                    //tsmi.DropDownItems["wageToolStripMenuItem"].Enabled = true;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Login failed !");
                }
            }
            else
            {
                MessageBox.Show("Login failed !");
            }
        }

        private void Login_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'stafScheDataSet.UserPwd' table. You can move, or remove it, as needed.
            this.userPwdTableAdapter.Fill(this.stafScheDataSet.UserPwd);

        }
    }
